\(\int \sqrt {a \cot ^2(x)} \, dx\) [26]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 10, antiderivative size = 16 \[ \int \sqrt {a \cot ^2(x)} \, dx=\sqrt {a \cot ^2(x)} \log (\sin (x)) \tan (x) \]

[Out]

ln(sin(x))*(a*cot(x)^2)^(1/2)*tan(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3739, 3556} \[ \int \sqrt {a \cot ^2(x)} \, dx=\tan (x) \sqrt {a \cot ^2(x)} \log (\sin (x)) \]

[In]

Int[Sqrt[a*Cot[x]^2],x]

[Out]

Sqrt[a*Cot[x]^2]*Log[Sin[x]]*Tan[x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3739

Int[(u_.)*((b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Tan[e + f*x]^n)^FracPart[p]/(Tan[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Tan[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {a \cot ^2(x)} \tan (x)\right ) \int \cot (x) \, dx \\ & = \sqrt {a \cot ^2(x)} \log (\sin (x)) \tan (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int \sqrt {a \cot ^2(x)} \, dx=\sqrt {a \cot ^2(x)} (\log (\cos (x))+\log (\tan (x))) \tan (x) \]

[In]

Integrate[Sqrt[a*Cot[x]^2],x]

[Out]

Sqrt[a*Cot[x]^2]*(Log[Cos[x]] + Log[Tan[x]])*Tan[x]

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.38

method result size
derivativedivides \(-\frac {\sqrt {a \cot \left (x \right )^{2}}\, \ln \left (\cot \left (x \right )^{2}+1\right )}{2 \cot \left (x \right )}\) \(22\)
default \(-\frac {\sqrt {a \cot \left (x \right )^{2}}\, \ln \left (\cot \left (x \right )^{2}+1\right )}{2 \cot \left (x \right )}\) \(22\)
risch \(-\frac {\sqrt {-\frac {a \left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right ) x}{{\mathrm e}^{2 i x}+1}-\frac {i \sqrt {-\frac {a \left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right ) \ln \left ({\mathrm e}^{2 i x}-1\right )}{{\mathrm e}^{2 i x}+1}\) \(94\)

[In]

int((a*cot(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*(a*cot(x)^2)^(1/2)/cot(x)*ln(cot(x)^2+1)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (14) = 28\).

Time = 0.26 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.69 \[ \int \sqrt {a \cot ^2(x)} \, dx=\frac {\sqrt {-\frac {a \cos \left (2 \, x\right ) + a}{\cos \left (2 \, x\right ) - 1}} \log \left (-\frac {1}{2} \, \cos \left (2 \, x\right ) + \frac {1}{2}\right ) \sin \left (2 \, x\right )}{2 \, {\left (\cos \left (2 \, x\right ) + 1\right )}} \]

[In]

integrate((a*cot(x)^2)^(1/2),x, algorithm="fricas")

[Out]

1/2*sqrt(-(a*cos(2*x) + a)/(cos(2*x) - 1))*log(-1/2*cos(2*x) + 1/2)*sin(2*x)/(cos(2*x) + 1)

Sympy [F]

\[ \int \sqrt {a \cot ^2(x)} \, dx=\int \sqrt {a \cot ^{2}{\left (x \right )}}\, dx \]

[In]

integrate((a*cot(x)**2)**(1/2),x)

[Out]

Integral(sqrt(a*cot(x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int \sqrt {a \cot ^2(x)} \, dx=-\frac {1}{2} \, \sqrt {a} \log \left (\tan \left (x\right )^{2} + 1\right ) + \sqrt {a} \log \left (\tan \left (x\right )\right ) \]

[In]

integrate((a*cot(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-1/2*sqrt(a)*log(tan(x)^2 + 1) + sqrt(a)*log(tan(x))

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int \sqrt {a \cot ^2(x)} \, dx=\frac {1}{2} \, \sqrt {a} \log \left (-\cos \left (x\right )^{2} + 1\right ) \mathrm {sgn}\left (\cos \left (x\right )\right ) \mathrm {sgn}\left (\sin \left (x\right )\right ) \]

[In]

integrate((a*cot(x)^2)^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(a)*log(-cos(x)^2 + 1)*sgn(cos(x))*sgn(sin(x))

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a \cot ^2(x)} \, dx=\int \sqrt {a\,{\mathrm {cot}\left (x\right )}^2} \,d x \]

[In]

int((a*cot(x)^2)^(1/2),x)

[Out]

int((a*cot(x)^2)^(1/2), x)